package com.lzy.liujing.restaurant.dao;


import com.lzy.liujing.restaurant.entity.MemberCategory;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MemberCategoryDao{

    @Select("select * from r_merber_category")
    List<MemberCategory> selectAll();

    @Select("select * from r_merber_category ")
    List<MemberCategory> findPage(MemberCategory query);

    @Delete("delete from r_merber_category where mc_id =#{mcId}")
    int delete(Integer id);

    @Insert("insert into r_merber_category (mc_name, discount, amount) values(#{mcName},#{discount},#{amount} )")
    int insert(MemberCategory brand);

    @Update("update r_merber_category set mc_name = #{mcName}, discount = #{discount}," +
            " amount = #{amount} where mc_id = #{mcId}")
    int update(MemberCategory brand);

    @Select("SELECT * FROM r_merber_category WHERE mc_id = #{mcId}")
    MemberCategory getById(Integer id);
}
